﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChurchDiary.TableEntity
{
    [Table("CH_ChurchWorker")]
    public class EntityChurchWorker : BaseEntity
    {
       
        [Key]
        public Guid ChurchWorkerId { get; set; }
        public int ChruchWokerRefNo { get; set; }
        public Guid? NameTitleId { get; set; }
        [MaxLength(8)]
        public string Initial { get; set; }
        [MaxLength(64)]
        public string FirstName { get; set; }
        [MaxLength(64)]
        public string MiddleName { get; set; }
        [MaxLength(64)]
        public string LastName { get; set; }
        [MaxLength(64)]
        public string FullName { get; set; }
        public int Gender { get; set; }
        [MaxLength(64)]
        public string Fathers { get; set; }
        [MaxLength(64)]
        public string NativePlace { get; set; }
        [MaxLength(64)]
        public string DateOfBirth { get; set; }

        [MaxLength(64)]
        public string DateOfSalvation { get; set; }
        [MaxLength(64)]
        public string DateOfBaptism { get; set; }
        [MaxLength(64)]
        public string DateOfAnointing { get; set; }
        [MaxLength(64)]
        public string DateOfJoiningInMinitry { get; set; }
        [MaxLength(64)]
        public string DateOfJoiningInOurMinitry { get; set; }

        public bool IsTakenTraining { get; set; }
        [MaxLength(64)]
        public string YearOfTraining { get; set; }
        [MaxLength(64)]
        public string PlaceOfTraining { get; set; }
        [MaxLength(64)]
        public string Education { get; set; }
        public Guid ChurchWorkerDesignationId { get; set; }
        public bool IsMarried { get; set; }
        [MaxLength(64)]
        public string DateOfMarriage { get; set; }
        [MaxLength(64)]
        public string NameOfLifePartner { get; set; }
        [MaxLength(500)]
        public string Remarks { get; set; }

        [EmailAddress]
        public string Email { get; set; }
        [Phone]
        public string Phone { get; set; }
        [Phone]
        public string AltPhone { get; set; }
        public string Photo { get; set; }
        [DefaultValue(false)]
        public bool CreateLogin { get; set; }

        /// <summary>
        /// 1.Active
        /// 2.Left Our Organization
        /// 3.Late
        /// 4.New Applicant From Web
        /// 5.Rejected Applicant
        /// 6.Approved Waiting for Interview
        /// </summary>
        public Guid ChurchWorkerStatusId { get; set; }
        public string PlaceOfApplication { get; set; }
        public string DateOfApplication { get; set; }
        public string ApplicationCopy { get; set; }
        /***** For New Applicant*****/
        public bool IsFromWebsite { get; set; }
        public bool IsHadOrdination { get; set; }
        public string AboutOrdination { get; set; }
        public string RecomantationLetter { get; set; }
        public string Testimony { get; set; }
        public string Testimonyfile { get; set; }
        public Guid PresentAddressId { get; set; }
        public bool IsDeclarted { get; set; }
        [NotMapped]
        public int TotalCounts { get; set; }
        /***** For New Applicant*****/
        public List<EntityChurchWorkerFamilyDetails> FamilyDetails { get; set; }
        public EntityChurchWorkerStatus Statuss { get; set; }
        public List<EntityChurchWorkerHistroy> Histroy { get; set; }
        public List<EntityChurchWorkerKnownlanguages> Knownlanguages { get; set; }
        public List<EntityChurchWorkerDocuments> Documents { get; set; }
        public EntityChurchWorkerDesignation Designation { get; set; }
        public EntityChurchWorkerPresentAddress PresentAddress { get; set; }
        public List<EntityChurchWorkerOrdinations> Ordination { get; set; }
    }
    [Table("CH_ChurchWorkerFamilyDetails")]
    public class EntityChurchWorkerFamilyDetails : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerFamilyId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public Guid RelationShipId { get; set; }
        public string Name { get; set; }
        public int Gender { get; set; }
        public string DateOfBirth { get; set; }

        public EntityRelationShip RelationShip { get; set; }
    }
    [Table("CH_ChurchWorkerStatus")]
    public class EntityChurchWorkerStatus : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerStatusId { get; set; }
        [MaxLength(100)]
        public string ChurchWorkerStatusName { get; set; }
        [MaxLength(500)]
        public string ChurchWorkerStatusDescription { get; set; }

        public EntityChurchWorker ChurchWorker { get; set; }
    }
    [Table("CH_ChurchWorkerHistroy")]
    public class EntityChurchWorkerHistroy : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerHistroyId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public Guid CHChurchid { get; set; }
        public string DateOfTakingCharge { get; set; }
        public string DateOfTransfer { get; set; }
        public string Remarks { get; set; }

        public EntityChurchWorker ChurchWorker { get; set; }
        public EntityChurch Church { get; set; }
    }
    [Table("CH_ChurchWorkerKnownlanguages")]                 
    public class EntityChurchWorkerKnownlanguages : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerKnownlanguagesId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public Guid LanguageId { get; set; }
        public bool All { get; set; }
        public bool Read { get; set; }
        public bool Write { get; set; }
        public bool Spoke { get; set; }

        public EntityLanguage Language { get; set; }
    }
    [Table("CH_ChurchWorkerDocuments")]
    public class EntityChurchWorkerDocuments : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerDocumentsId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public Guid DocumentId { get; set; }
        public string Documentfile { get; set; }
        public string Description { get; set; }

        public EntityDocuments Documents { get; set; }
    }
    [Table("CH_ChurchWorkerDesignation")]
    public class EntityChurchWorkerDesignation : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerDesignationId { get; set; }
        public int Gender { get; set; }
        public string ChurchWorkerDesignationName { get; set; }
        public string ChurchWorkerDesignationAbrivation { get; set; }
        public int ChurchWorkerDesignationLevel { get; set; }


        [NotMapped]
        public int Counts { get; set; }

    }
    [Table("CH_ChurchWorkerPresentAddress")]
    public class EntityChurchWorkerPresentAddress : BaseEntity
    {
        [Key]
        public Guid PresentAddressId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public Guid PresentCountryId { get; set; }
        public Guid PresentState { get; set; }
        public string PresentCity { get; set; }
        public string PresentAddress { get; set; }
        public string PresentPin { get; set; }


    }
    [Table("CH_ChurchWorkerOrdinations")]
    public class EntityChurchWorkerOrdinations : BaseEntity
    {
        [Key]
        public Guid OrdinationId { get; set; }
        public Guid ChurchWorkerDesignationId { get; set; }
        public Guid OrdinationedBy { get; set; }
        public string DateOfOrdination { get; set; }
        public Guid ChurchWorkerId { get; set; }

        public EntityChurchWorkerDesignation Designation { get; set; }
        public EntityChurchWorker ChurchWorker { get; set; }


    }

    [Table("CH_ChurchWorkerDeclaration")]
    public class EntityChurchWorkerDeclaration : BaseEntity
    {
        [Key]
        public Guid DeclartionId { get; set; }
        public string Declartion { get; set; }
    }
    [Table("CH_ChurchWorkerEducationDetails")]
    public class EntityChurchWorkerEducationDetails : BaseEntity
    {
        [Key]
        public Guid EducationDetailsId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public string EducationDegree { get; set; }
        public string Yearfrom { get; set; }
        public string Yearto { get; set; }
        public string DegreeStatus { get; set; }
        public string Remarks { get; set; }
    }
    [Table("CH_ChurchWorkerJobtitle")]
    public class EntityChurchWorkerJobtitle : BaseEntity
    {
        [Key]
        public Guid ChurchWorkerJobtitleId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public int MiniterialType { get; set; }
        public Guid PartitionId { get; set; }

        public Guid ChurchId { get; set; }
        public Guid JobtitleId { get; set; }
        
        public string DateOfOrdination { get; set; }
        public string Remarks { get; set; }

        public int CurrentStatus { get; set; }
        

        public EnitityOrganizationPartition OrganizationPartition { get; set; }
        public EntityJobtitle Jobtitle { get; set; }
        public EntityChurch Church { get; set; }
        public EntityChurchWorker ChurchWorker { get; set; }
        
        public EntityChurchWorkerStatus ChurchWorkerStatus { get; set; }

    }


}

